linalg_inverse Module


Uses


Interfaces

public interface mtx_inverse

  • private subroutine mtx_inverse_dbl(a, iwork, work, olwork, err)

    Computes the inverse of a square matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the N-by-N matrix to invert. On output, the inverted matrix.

    integer(kind=int32), intent(out), optional, target, dimension(:) :: iwork

    An optional N-element integer workspace array.

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private subroutine mtx_inverse_cmplx(a, iwork, work, olwork, err)

    Computes the inverse of a square matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the N-by-N matrix to invert. On output, the inverted matrix.

    integer(kind=int32), intent(out), optional, target, dimension(:) :: iwork

    An optional N-element integer workspace array.

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

public interface mtx_pinverse

  • private subroutine mtx_pinverse_dbl(a, ainv, tol, work, olwork, err)

    Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the M-by-N matrix to invert. The matrix is overwritten on output.

    real(kind=real64), intent(out), dimension(:,:) :: ainv

    The N-by-M matrix where the pseudo-inverse of will be written.

    real(kind=real64), intent(in), optional :: tol

    An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are forced to have a reciprocal of zero, as opposed to 1/S(I). The default tolerance is: MAX(M, N) * EPS * MAX(S).

    real(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.

  • private module subroutine mtx_pinverse_cmplx(a, ainv, tol, work, olwork, rwork, err)

    Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(inout), dimension(:,:) :: a

    On input, the M-by-N matrix to invert. The matrix is overwritten on output.

    complex(kind=real64), intent(out), dimension(:,:) :: ainv

    The N-by-M matrix where the pseudo-inverse of will be written.

    real(kind=real64), intent(in), optional :: tol

    An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are forced to have a reciprocal of zero, as opposed to 1/S(I). The default tolerance is: MAX(M, N) * EPS * MAX(S).

    complex(kind=real64), intent(out), optional, target, dimension(:) :: work

    An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

    integer(kind=int32), intent(out), optional :: olwork

    An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

    real(kind=real64), intent(out), optional, target, dimension(:) :: rwork

    An optional input, that if provided, prevents any local memory allocation for real-valued workspaces. If not provided, the memory required is allocated within. If provided, the length of the array must be at least 6 * MIN(M, N).

    class(errors), intent(inout), optional, target :: err

    The error object to be updated.